package com.wh.accesscontrol.service.lmpl;

import com.wh.accesscontrol.dao.StadiumMapper;
import com.wh.accesscontrol.entity.Stadium;
import com.wh.accesscontrol.service.StadiumService;
import com.wh.accesscontrol.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("StadiumServiceImpl")
public class StadiumServiceImpl implements StadiumService {
    @Autowired
    private StadiumMapper stadiumMapper;
    @Override
    public List<Stadium> listByDay(int student) {

        return   stadiumMapper.lisrByDayandStudent(DateUtil.getDayStartTime(),DateUtil.getDayEndTime(),student);
    }

    @Override
    public List<Stadium> listByWeek(int student) {
        return stadiumMapper.lisrByDayandStudent(DateUtil.getDayStartTime(),DateUtil.getDayEndTime(),student);
    }

    /**
     * 获取当天的所有记录
     *
     * @return {@link List<Stadium>}
     */
    @Override
    public List<Stadium> listByAllday() {
        return stadiumMapper.lisrByDay(DateUtil.getDayStartTime(),DateUtil.getDayEndTime());
    }


}
